/**
 * match
 * samedi 02 09 2017
 */
package base;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.function.Function;

/**
 * @author match
 * samedi 02 09 2017
 */
public class lambda {

	/**
	 * 
	 */
	public lambda() {
	}
	
	private static <T,R> List<R> map(List<T> list,Function<T,R> f)
	{
		List<R> result=new ArrayList<>();
		for(T s:list)
		{
			result.add(f.apply(s));
		}
		return result;
		
	}

	public static void main(String[] args) {
		
		List<Integer> l=map(Arrays.asList("lambdas","in","action"),s->s.length());
		System.out.println(l);
	}

}
